import { rendererInvoke } from '@common/rendererIpc';
import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames';

//登录，需要返回登录消息
export const login = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.login, data);
};

//添加视频编辑标注信息
export const addMarkInfo = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.addMarkInfo, data);
};

//添加实时监控标注信息
export const addRealTimeMarkItem = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.addRealTimeMarkItem, data);
};

export const getFileSize = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.getFileSize, data);
};

//查询视频列表-分页
export const getVideoInfoQuery = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.getVideoInfoQuery, data);
};

//总记录数
export const getVideoInfoListCount = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.getVideoInfoListCount, data);
};

//新增
export const addVideo = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.addVideo, data);
};

//删除
export const deleteVideo = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.deleteVideo, data);
};

//视频标注列表
export const getVideoMarkListByVedioId = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.getVideoMarkListByVedioId, data);
};

/**
 * 视频标注信息列表-导出
 * @returns
 */
export const getRightMarkListByVideoId = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.getRightMarkListByVideoId, data);
};

/**
 * 删除标注
 */
export const deleteMarkInfo = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.deleteMarkInfo, data);
};

/** 新增标注 */
export const addMarkItemInfo = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.addMarkItemInfo, data);
};

/**
 * 查询标注
 */
export const getTextMarkInfoQuery = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.getTextMarkInfoQuery, data);
};

export const getTextMarkInfoQueryCount = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.getTextMarkInfoQueryCount, data);
};
//删除
export const deleteMark = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.deleteMark, data);
};

//视频列表
export const selectVideoListByIds = async (data: any) => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.selectVideoListByIds, data);
};

//更新用户密码
export const updatePassword = async (data: any) => {
  console.log(data);
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.updatePassword, data);
};

//通道列表
export const getChannelFromDb = async () => {
  return rendererInvoke<any>(WIN_MAIN_RENDERER_EVENT_NAME.getChannelFromDb);
};
